#include <iostream>
#define N 1000

using namespace std;


int main(){

int array[N];
int i;
int n;
int k;
int karray[N];
int j=0;

cout<<"Type the number of elements you want in the array"<<endl;
cin>>n;
cout<<"Type the elements"<<endl;
for(i=0; i<n; i++){
	cin>>array[i];}

cout<<"The original array is ";
for(i=0; i<n; i++){
	cout<<array[i]<<" ";}
cout<<endl;

cout<<"Type a number which divides the elements ";
cin>>k;

for(i=0;i<n;i++){
	if(array[i] % k==0){
		karray[j]=array[i];
			j++;}
}

cout<<"The array with divisions without floating parts is:";
for(i=0;i<j;i++){
	cout<< karray[i]<< " ";}

cout<<endl;
return 0;
}
